package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.FundTransactionFlow;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * 现金券交易流水
 * Created by zhangjh on 2017/1/15.
 */
@Entity
@Table(name = "mall_cash_coupon_flow")
@DynamicInsert(value = true)
@DynamicUpdate(value = true)
public class MallCashCouponFlow  extends IDEntityMall {
    /**
     *
     */
    @Column(columnDefinition = "bigint comment '现金券id'")
    private Long cashCouponId;


    @Column(columnDefinition = "bigint(20) comment '平台ID'")
    private Long mallId;


    @Column(columnDefinition = "DECIMAL(30,10) default 0 comment '操作金额'")
    private BigDecimal operationAmount = BigDecimal.valueOf(0);

    @Column(columnDefinition = "varchar(50) comment '交易方向 INCOME(\"收入\", \"+\"), EXPEND(\"支出\", \"-\")'")
    @Enumerated(EnumType.STRING)
    private FundTransactionFlow transactionFlow;

    public Long getCashCouponId() {
        return cashCouponId;
    }

    public void setCashCouponId(Long cashCouponId) {
        this.cashCouponId = cashCouponId;
    }

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public BigDecimal getOperationAmount() {
        return operationAmount;
    }

    public void setOperationAmount(BigDecimal operationAmount) {
        this.operationAmount = operationAmount;
    }

    public FundTransactionFlow getTransactionFlow() {
        return transactionFlow;
    }

    public void setTransactionFlow(FundTransactionFlow transactionFlow) {
        this.transactionFlow = transactionFlow;
    }

    @Override
    public String toString() {
        return "MallCashCouponFlow{" +
                "cashCouponId=" + cashCouponId +
                ", id=" + id +
                ", mallId=" + mallId +
                ", dateCreated=" + dateCreated +
                ", operationAmount=" + operationAmount +
                ", lastUpdated=" + lastUpdated +
                ", isDelete=" + isDelete +
                ", transactionFlow=" + transactionFlow +
                ", version=" + version +
                '}';
    }
}
